package about_attributes.demo1;

/**
 * @author yuisama
 * @date 2022/10/01 14:43
 **/
public class Main4 {
    static class MyThread extends Thread{

        public MyThread(String name){
            //调用父类thread的构造方法
            super(name);
            //seatName(name);
        }

        @Override
        public void run() {
            System.out.println(this.getName());
        }

        public static void main(String[] args) {
            Thread thread = Thread.currentThread();//当前线程
            System.out.println(thread.getName());

            MyThread t1 = new MyThread("我是t1~");
            t1.start();

            MyThread t2 = new MyThread("我是t2~");
            t2.start();

            MyThread t3 = new MyThread("我是t3");
            t3.start();
        }
    }
}

